<template>
  <div>
    <el-card style="margin: 10px 0px">
      <!--文件显示-->
      <div>
        <div class="in">
          <i></i>
        </div>
        <div class="in">
          {{sectionData.fileName}}
        </div>
        <div class="in r">
          <el-button>点击下载</el-button>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'CourseFile',
  data () {
    return {
      courseId: this.$route.query.courseId,
      sectionId: this.$route.query.sectionId,
      sectionData: []
    }
  },
  mounted () {
    this.getFile()
  },
  methods: {
    getFile () {
      var _this = this
      this.$axios.post('/api/section/getSection',
        this.$qs.stringify({
          sectionId: this.sectionId
        })
      ).then(function (response) {
        var data = response.data
        if (data.isSuccess) {
          var result = data.result
          _this.sectionData = result
        }
      })
    }
  }
}
</script>

<style scoped>
  .in {
    display: inline-block;
  }
  .r {
    float: right;
  }
</style>
